﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using KerriganDataContract.DrivingMode;
using System.ComponentModel;

namespace KerriganDataContract.Formation
{
    [DataContract]
    public class FormationDC : INotifyPropertyChanged
    {
        private int _Id;
        private int _Price;
        private string _Name;
        private FormationCategoryDC _FormationCategory;
        private int _Duration;
        private int _UnitDuration;
        private DrivingModeDC _DrivingMode;
        private int _TypeFormation;
        private Boolean _IsCircuit;
        
        [DataMember]
        public int Id
        {
            get { return this._Id; }
            set { this._Id = value; OnPropertyChanged("Id"); }
        }

        [DataMember]
        public int Price
        {
            get { return this._Price; }
            set { this._Price = value; OnPropertyChanged("Price"); }
        }

        [DataMember]
        public string Name
        {
            get { return this._Name; }
            set { this._Name = value; OnPropertyChanged("Name"); }
        }

        [DataMember]
        public FormationCategoryDC FormationCategory
        {
            get { return this._FormationCategory; }
            set { this._FormationCategory = value; OnPropertyChanged("FormationCategory"); }
        }

        [DataMember]
        public int Duration
        {
            get { return this._Duration; }
            set { this._Duration = value; OnPropertyChanged("Duration"); }
        }

        [DataMember]
        public int UnitDuration
        {
            get { return this._UnitDuration; }
            set { this._UnitDuration = value; OnPropertyChanged("UnitDuration"); }
        }

        [DataMember]
        public DrivingModeDC DrivingMode
        {
            get { return this._DrivingMode; }
            set { this._DrivingMode = value; OnPropertyChanged("DrivingMode"); }
        }

        [DataMember]
        public int TypeFormation
        {
            get { return this._TypeFormation; }
            set { this._TypeFormation = value; OnPropertyChanged("TypeFormation"); }
        }

        [DataMember]
        public Boolean IsCircuit
        {
            get { return this._IsCircuit; }
            set { this._IsCircuit = value; OnPropertyChanged("IsCircuit"); }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        private void OnPropertyChanged(string property)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(property));
            }
        }
    }
}
